package com.kang.util;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class OssPropertiesUtils implements InitializingBean {

    @Value("${aliyun.oss.accessKeyId}")
    private String accessKeyId;

    @Value("${aliyun.oss.secret}")
    private String secret;

    @Value("${aliyun.oss.endpoint}")
    private String endpoint;

    @Value("${aliyun.oss.bucket}")
    private String bucket;



    public static String ALIYUN_OSS_ACCESSKEYID;
    public static String ALIYUN_OSS_SECRET;
    public static String ALIYUN_OSS_ENDPOINT;
    public static String ALIYUN_OSS_BUCKET;

    @Override
    public void afterPropertiesSet() {
        ALIYUN_OSS_ACCESSKEYID = accessKeyId;
        ALIYUN_OSS_SECRET = secret;
        ALIYUN_OSS_ENDPOINT = endpoint;
        ALIYUN_OSS_BUCKET = bucket;
    }
}
